package dfl.bysj.config.model.VO;


import dfl.bysj.config.model.WxUserInfo;
import dfl.bysj.entity.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

//import java.io.Serializable;
import java.io.Serializable;
import java.util.List;
 
@Data
@NoArgsConstructor
@AllArgsConstructor
public class UserDto implements Serializable {
    private static final long serialVersionUID = 1L;

    private String dto_info;
    private User user;
 
    //dto拓展属性
//    private String token;
//    List<String> permissions;
//    List<String> roles;
    //验证码
    private String code;

    private Teacher teacher;

    private Grade grade;

    private Academy academy;

    private Student student;
 
    public void from(WxUserInfo wxUserInfo) {
        this.user=new User();
        this.user.setNickname(wxUserInfo.getNickName());
        this.user.setPortrait(wxUserInfo.getAvatarUrl());
        this.user.setGender(wxUserInfo.getGender());
        this.user.setOpenId(wxUserInfo.getOpenId());
        this.user.setWxUnionId(wxUserInfo.getUnionId());
    }
}